import request from '@/utils/request'

export function allList(url, data = {}) {
  return request({
    url: url + "/allList",
    method: 'get',
    params: data
  })
}

export function queryList(url, data = {}) {
  return request({
    url: url + "/queryList",
    method: 'get',
    params: data
  })
}

export function queryPageListPost(url, data = {}) {
  return request({
    url:`${url}/queryPage/${data.page}/${data.limit}`,
    method: 'post',
    data
  })
}

export function queryPageListGet(url, data = {}) {
  return request({
    url:`${url}/queryPage`,
    method: 'get',
    params: data,
  })
}

export function info(url, data) {
  return request({
    url: url + "/info/" + data,
    method: 'get'
  })
}

export function deleteById(url, data) {
  return request({
    url: url + "/delete/" + data,
    method: 'delete'
  })
}

export function save(url, data) {
  return request({
    url: url + "/save",
    method: 'post',
    data
  })
}

export function update(url, data) {
  return request({
    url: url + "/update",
    method: 'put',
    data
  })
}

export default { allList, queryList, queryPageListPost, queryPageListGet, info, deleteById, save, update }